
/**
 *	A wrapper class for b2Vec2 in box2d.
 * This is really just a wrapper class for b2Vec2 in C++. You
 * should not use methods in this class too often.
**/
public final class b2Vec2 extends b2AllocationGuard {

	public b2Vec2(int addr) {
		super(addr);
	}

	@Override
	public void release() {
		if ( address != 0 ) {
			jni_b2Vec2_release(address);
			super.release();
		}
	}


	/**Default constructor does nothing*/
	public b2Vec2() {
		address = jni_b2Vec2();
	}

	/**Construct using coordinates.*/
	public b2Vec2(float x, float y) {
		address = jni_b2Vec2_xy(x, y);
	}

	/**Set this vector to all zeros.*/
	public void SetZero() {
		jni_b2Vec2_SetZero(address);
	}

	/**Set this vector to some specified coordinates.*/
	public void Set(float x, float y) {
		jni_b2Vec2_Set(address, x, y);
	}

	private static native int jni_b2Vec2();
	private static native int jni_b2Vec2_xy(float x, float y);
	private static native void jni_b2Vec2_release(int me);
	private static native void jni_b2Vec2_SetZero(int me);
	private static native void jni_b2Vec2_Set(int me, float x, float y);
}
